package com.school.manager.exception;

import com.school.manager.enums.ExceptionEnum;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * description：自定义异常
 * date：2021/10/124:39 下午
 */

@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
public class BussinessException extends RuntimeException {

    public BussinessException(ExceptionEnum exceptionEnum) {
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
    }

    private final int code;

    private final String message;
}
